package com.credithc.customers.manager.controller;

import com.credithc.baseserv.core.codes.CoreCodes;
import com.credithc.baseserv.core.message.Message;
import com.credithc.baseserv.core.message.MessageFactory;
import com.credithc.baseserv.pageHelper.PageInfo;
import com.credithc.customers.manager.po.DesensitizedAccessPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zhukai
 * @date 2019/1/2 11:24
 */
@Controller
@RequestMapping("/manager/yzt/v1")
public class AdminController {

    private final MessageFactory messageFactory;

    @Autowired
    public AdminController(MessageFactory messageFactory) {
        this.messageFactory = messageFactory;
    }

    @GetMapping("/desensitized")
    @ResponseBody
    public Message getDesensitizedAccess(){
        List<DesensitizedAccessPo> list = new ArrayList<>();
        DesensitizedAccessPo po = new DesensitizedAccessPo();
        po.setId("canSeeAllData");
        po.setName("全部数据");
        list.add(po);
        PageInfo pageInfo = new PageInfo(list, (int) 1, 1, 20);
        Map<String, Object> map = new HashMap<>();
        map.put("pageInfo",pageInfo);
        return messageFactory.getInstance(CoreCodes.CORE_SUCCESS, map);
    }

}
